package com.bawei.doctor.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bawei.common.utils.PageUtils;
import com.bawei.common.utils.Query;

import com.bawei.doctor.dao.GradeMarkDao;
import com.bawei.doctor.entity.GradeMarkEntity;
import com.bawei.doctor.service.GradeMarkService;


@Service("gradeMarkService")
public class GradeMarkServiceImpl extends ServiceImpl<GradeMarkDao, GradeMarkEntity> implements GradeMarkService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<GradeMarkEntity> page = this.page(
                new Query<GradeMarkEntity>().getPage(params),
                new QueryWrapper<GradeMarkEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<GradeMarkEntity> hospitalList() {
        List<GradeMarkEntity> hospitalList = baseMapper.selectList(new QueryWrapper<GradeMarkEntity>().eq("parent_id", 0));
        return hospitalList;
    }

    @Override
    public List<GradeMarkEntity> roomList(Integer pid) {
        List<GradeMarkEntity> roomList = baseMapper.selectList(new QueryWrapper<GradeMarkEntity>().eq("parent_id", pid));
        return roomList;
    }

}